package com.example.beidouapplication;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;

import com.example.beidouapplication.databinding.FragmentContentParaSetBinding;
import com.example.beidouapplication.databinding.FragmentContentParaSetS2Binding;
import com.example.beidouapplication.viewmodel.Key;
import com.example.beidouapplication.viewmodel.KeyEvent;
import com.jay.easykeyboard.SystemKeyBoardEditText;


public class FragmentParaSetS2 extends Fragment {


    Button enter;
    Button cancel;


    static FragmentParaSetS2 instance = new FragmentParaSetS2();
    FragmentContentParaSetS2Binding binding;

    @Override
    public View onCreateView(
            LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState
    ) {

        binding = DataBindingUtil.inflate(inflater, R.layout.fragment_content_para_set_s2, container, false);
        binding.setData(MainActivity.paraSetData);

        return binding.getRoot();
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        enter =  getActivity().findViewById(R.id.btn_para_set_s2_enter);
        cancel =  getActivity().findViewById(R.id.btn_para_set_s2_cancel);
        enter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Menu.keyQueue.add(new KeyEvent(Key.ENTER, -1));
            }
        });
        cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Menu.keyQueue.add(new KeyEvent(Key.Esc, -1));
            }
        });

    }

    @Override
    public void onResume() {
        super.onResume();

    }
}